package net.wicp.tams.commons.zookeeper.opt;

import org.apache.zookeeper.KeeperException;

import net.wicp.tams.commons.Result;
import net.wicp.tams.commons.zookeeper.ZK;
import net.wicp.tams.commons.zookeeper.IZKOpt;

public class ZKUnLockOpt implements IZKOpt {

	private final String path;

	public ZKUnLockOpt(String path) {
		this.path = path;
	}

	@Override
	public Result execute() throws KeeperException, InterruptedException {
		ZK.getInstance().getZk().delete(path, -1);
		return Result.getSuc();
	}

}
